<%@ page import="pl.dmcs.grails.Employee" %>

<g:each in="${employeeList}" status="i" var="employeeInstance">
    <fieldset>
        <legend>
            <g:link action="show" id="${employeeInstance.id}">
                ${employeeInstance.fullName}
            </g:link>
        </legend>
        <table>
            <tr>
                <td rowspan="5">
                    <g:if test="${employeeInstance?.avatar}">
                        <g:if test="${employeeInstance.avatar}">
                            <img class="form-img" src="${createLink(controller:'employee', action:'getAvatar', id:employeeInstance.id)}" />
                        </g:if>
                    </g:if>
                </td>
            </tr>
            <tr>
                <td>
                    <label for="firstName">
                        ${message(code: 'employee.firstName.label', default: 'First Name')}
                    </label>
                </td>
                <td>
                    ${fieldValue(bean: employeeInstance, field: "firstName")}
                </td>
            </tr>
            <tr>
                <td>
                    <label for="lastName">
                        ${message(code: 'employee.lastName.label', default: 'Last Name')}
                    </label>
                </td>
                <td>
                    ${fieldValue(bean: employeeInstance, field: "lastName")}
                </td>
            </tr>
            <tr>
                <td>
                    <label for="email">
                        ${message(code: 'employee.email.label', default: 'Email')}
                    </label>
                </td>
                <td>
                    ${fieldValue(bean: employeeInstance, field: "email")}
                </td>
            </tr>
            <tr>
                <td>
                    <label for="room">
                        ${message(code: 'employee.room.label', default: 'Room')}
                    </label>
                </td>
                <td>
                    ${fieldValue(bean: employeeInstance, field: "room")}
                </td>
            </tr>
        </table>
    </fieldset>
</g:each>